home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / fgrep.z / fgrep
Text File  |  1998-10-20  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4. FFFFGGGGRRRREEEEPPPP((((1111))))                                                              FFFFGGGGRRRREEEEPPPP((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      fgrep - search a file for a character string
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ffffggggrrrreeeepppp [options] string [file ...]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _f_g_r_e_p (fast _g_r_e_p) searches files for a character string and prints all
  16.      lines that contain that string.  _f_g_r_e_p is different from _g_r_e_p(_1) and
  17.      _e_g_r_e_p(_1) because it searches for a string, instead of searching for a
  18.      pattern that matches an expression.  It uses a fast and compact
  19.      algorithm.
  20.  
  21.      The characters $$$$, ****, [[[[, ^^^^, |, ((((, )))), and \\\\ are interpreted literally by
  22.      _f_g_r_e_p, that is, _f_g_r_e_p does not recognize full regular expressions as does
  23.      _e_g_r_e_p.  Since these characters have special meaning to the shell, it is
  24.      safest to enclose the entire _s_t_r_i_n_g in single quotes ''''...''''.
  25.  
  26.      If no files are specified, _f_g_r_e_p assumes standard input.  Normally, each
  27.      line found is copied to the standard output.  The file name is printed
  28.      before each line found if there is more than one input file.
  29.  
  30.      Command line options are:
  31.  
  32.      ----bbbb    Precede each line by the block number on which it was found.  This
  33.            can be useful in locating block numbers by context (blocks are 512
  34.            bytes long and number from 0).
  35.      ----cccc    Print only a count of the lines that contain the pattern.
  36.      ----iiii    Ignore upper/lower case distinction during comparisons.
  37.      ----llll    Print the names of files with matching lines once, separated by
  38.            new-lines.  Does not repeat the names of files when the pattern is
  39.            found more than once.
  40.      ----nnnn    Precede each line by its line number in the file (first line is 1).
  41.      ----ssss    Silent mode.  No pattern matches or error messages are printed.
  42.            This option allows command expressions to check _f_g_r_e_p's exit status
  43.            without having to deal with output.
  44.      ----vvvv    Print all lines except those that contain the pattern.
  45.      ----xxxx    Print only lines matched entirely.
  46.      ----eeee _s_p_e_c_i_a_l__s_t_r_i_n_g
  47.            Search for a _s_p_e_c_i_a_l _s_t_r_i_n_g (_s_t_r_i_n_g begins with a ----).
  48.      ----ffff _f_i_l_e
  49.            Take the list of _s_t_r_i_n_g_s from _f_i_l_e.
  50.  
  51. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  52.      ed(1), egrep(1), grep(1), sed(1), sh(1).
  53.  
  54. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  55.      Exit status is 0 if any matches are found, 1 if none, 2 for syntax errors
  56.      or inaccessible files (even if matches were found).
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FFFFGGGGRRRREEEEPPPP((((1111))))                                                              FFFFGGGGRRRREEEEPPPP((((1111))))
  71.  
  72.  
  73.  
  74. BBBBUUUUGGGGSSSS
  75.      Ideally there should be only one _g_r_e_p command, but there is not a single
  76.      algorithm that spans a wide enough range of space-time tradeoffs.  Lines
  77.      are limited to BUFSIZ characters; longer lines are truncated.  BUFSIZ is
  78.      defined in ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee////ssssttttddddiiiioooo....hhhh.
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.